package com.itheima.dao;

import com.itheima.model.domain.Article;
import com.itheima.model.domain.Comment;
import com.itheima.model.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author chenxiangxi
 * @create 2023/6/5 22:17
 */

@Mapper
public interface UserMapper {

    @Select("SELECT * FROM t_user ORDER BY id DESC")
    public List<User> getAllUsers();

    @Delete("DELETE FROM t_user WHERE id=#{id}")
    void deleteUserById(int id);

    @Select("SELECT * FROM t_user WHERE id=#{id}")
    User selectUserById(int id);
}
